#@resources()
<body>
<div class="container">
    <!--表格-->
    <div class="toolbar">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'fa fa-tags'" onclick="test()">我是按钮</a>
        <a href="javascript:void(0)" class="easyui-linkbutton default">我也是按钮</a>
        <a href="javascript:void(0)" class="easyui-linkbutton primary" data-options="iconCls:'fa fa-area-chart'"></a>
        <a href="javascript:void(0)" class="easyui-linkbutton error" data-options="iconCls:'fa fa-gears'"></a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="disabled:true">禁用按钮</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true" onclick="add()">简洁按钮</a>
    </div>

    <div class="_datagrid">
        <table id="dg"></table>
    </div>
</div>
<script type="text/javascript">
    function test() {
        $.messager.confirm('确认','您确认想要删除记录吗？',function(r){
            if (r){
                alert('确认删除');
            }
        });
    }

    $('#dg').datagrid({
        url: '#(ctx)/static/js/data/datagrid_data.json',
        fit: true,
        pagination: true,
        fitColumns: true,
        height: 400,
        columns: [
            [{
                field: 'productid',
                title: 'productid',
                width: 100,
                sortable: true
            }, {
                field: 'productname',
                title: 'productname',
                width: 100,
                sortable: true
            }, {
                field: 'unitcost',
                title: 'unitcost',
                width: 100,
                align: 'right',
                sortable: true
            }, {
                field: 'status',
                title: 'status',
                width: 100,
                align: 'right'
            }, {
                field: 'listprice',
                title: 'listprice',
                width: 100,
                align: 'right'
            }, {
                field: 'attr1',
                title: 'attr1',
                width: 100,
                align: 'right'
            }, {
                field: 'itemid',
                title: 'itemid',
                width: 100,
                align: 'right'
            }]
        ],
    });

    <!--添加方法-->
    function add() {
        parent.$.modalDialog.openner = $('#dg');
        parent.$.modalDialog({
            title: "添加公司",
            width: 300,
            height: 300,
            href: "http://www.baidu.com"
        });
    }
</script>